package com.warm.satoken.config;

import cn.dev33.satoken.dao.SaTokenDao;
import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;
import org.noear.solon.serialization.jackson.JacksonRenderFactory;
import org.redisson.api.RedissonClient;

@Configuration
public class SaTokenConfig {

    /**
     * 构建 SaTokenDao
     */
    @Bean
    public SaTokenDao saTokenDaoInit(RedissonClient redissonClient
            , @Inject JacksonRenderFactory factory) {
        return new SaTokenDaoRedissonJackson(redissonClient, factory.config());
    }
}
